add a new bug file
###Date 2020/6/29
#!/bin/sh
FIND_KEY='.test.51offer.com'
OLD_VALUE=$2
NEW_VALUE=$3

FILES=$(git rev-list --objects $OLD_VALUE...$NEW_VALUE | egrep '\.(jsp|vm|java)$' | awk '{print $2}' | sort | uniq )

FLAG=0
for FILE in $FILES
do
    git show $NEW_VALUE:$FILE | grep -q "$FIND_KEY"
    if [ $? -eq 0 ]
    then
        FLAG=1
        echo "  包含非法字段 '$FIND_KEY' : $FILE"
    fi
done

if [ $FLAG -eq 0 ]
then
    echo "  代码检查通过."
else
    echo "  代码检查不通过!"
    exit 1
fi

exit 0
